package com.hpe.wx.performance.redis.dao;

import java.util.List;
import java.util.Set;

import org.springframework.stereotype.Repository;

import redis.clients.jedis.Tuple;

@Repository
public interface PerformanceDao {
	public String add(String key, String value);
	
	public Long remove(String key);

	public String getValueByKey(String key);

	public Long zAdd(String key, double score, String member);
	
	public Long zRemove(String key, String member);
	
	public Set<Tuple> popSortedSet(String key, int sort);

	/**
	 * @param key
	 * @param indexStart
	 * @param indexEnd
	 * @param sortedBy    if 0, sorted by inc, if 1 ,order by desc
	 * @return
	 */
	public Set<Tuple> getSortedSetByIndex(String key, long indexStart, long indexEnd, int sortedBy);
	
	public Set<Tuple> getSortedSetByScore(String key, String scoreStart, String scoreEnd, int sortedBy);
	
	public Set<Tuple> getSortedSetByScore(String key, double scoreStart, double scoreEnd, int sortedBy);
	
	//operations for list 
	public Long lPush(String key, String value);

	public List<String> lGet(String key, int  indexStart, int indexEnd);
}
